cmake_minimum_required(VERSION 3.10)

set(project_name testDevice)

project(${project_name})

set(CMAKE_CXX_STANDARD 17)
SET(CMAKE_BUILD_TYPE "Debug")
SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb")

add_library(${project_name}-lib
    src/DeviceInfo.h
    src/newDataEvent.hpp
    src/DeviceClient.hpp
    src/DataTransmit.hpp
    src/dto/UploadDTO.hpp
    src/systemInfo.hpp
    src/systemInfo.cpp
)

find_package(oatpp 1.3.0 REQUIRED)

target_link_libraries(${project_name}-lib
        PUBLIC oatpp::oatpp
)

target_include_directories(${project_name}-lib PUBLIC src)

add_executable(${project_name}-exe
        src/App.cpp
)

target_link_libraries(${project_name}-exe ${project_name}-lib)
add_dependencies(${project_name}-exe ${project_name}-lib)